$().ready(function () {
    $("#addNewKeyword_form").validate({
        rules: {
            keyword: "required",
            kwType: "required",
        },
        messages: {
            keyword: "请输入关键字",
            kwType: "请输入关键字类型",
        }
    });
});
$(function () {
    $(".addKeyword").click(function () {
        let error = $(".form-group .col-sm-8 label");
        if (error) {
            $(error).each(function () {
                $(this).css("display", "none");
            })
        }

        let exception = $(".modal-footer .addKeywordException");
        if (exception) {
            $(exception).each(function () {
                $(this).css("display", "none");
            })
        }
    });
    $(".addKeywordSubmit").click(function () {
        let exception = $(".modal-footer .addKeywordException");
        if (exception) {
            $(exception).each(function () {
                $(this).css("display", "none");
            })
        }
    });

    $(".clearCont").click(function () {
        console.log($(".searchInput").val())
        $(".searchInput").val("");
        $(this).css("display","none");
    });
    $(".searchInput").bind('input propertychange', function() {
       if($(this).val()===""){
           $(".clearCont").css("display","none");
       }else{
           $(".clearCont").css("display","inline-block");
       }
    })
    if($(".searchInput").val()){
        $(".clearCont").css("display","inline-block");
    }
});
/**
 * Created by 13296 on 2017/8/18.
 */
